home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga CD-ROM Collection
/
Amiga CD-ROM Collection - Auge 4000 and Cactus and Demo Util.iso
/
auge4000
/
46
/
lib
/
string
/
strnicmp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-06-20
|
415b
|
34 lines
/*
* STRNICMP.C
*
* (C)Copyright 1990, Matthew Dillon, All Rights Reserved
*/
#include <string.h>
typedef unsigned char ubyte;
int
strnicmp(s, d, n)
const char *s;
const char *d;
int n;
{
ubyte c;
if (n == 0)
return(0);
while (tolower(c = *s) == tolower(*(ubyte *)d)) {
if (c == 0 || --n == 0)
return(0);
++s;
++d;
}
if ((ubyte)c < (ubyte)*d)
return(-1);
return(1);
}